home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freaks Macintosh Archive
/
Freaks Macintosh Archive.bin
/
Freaks Macintosh Archives
/
Textfiles
/
Hacking
/
UnixCPrograms.sit
/
UnixCPrograms
/
phunk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-05
|
2KB
|
63 lines
/* /===============------ - - ---- - - - - */
/* | -* pHUNk v0.0.2 *- */
/* | wERD! this is only my third C program EVER! */
/* | so if you think it sux, and could be written */
/* | better, you're absolutely right.. */
/* | */
/* | It's mainly based on James Manning's random.c, */
/* | and set_to_lower() is even taken right out of */
/* | random.c! =) */
/* | */
/* | to use, type "/alias phunk /exec -out echo "$0-" |phunk" */
/* | inside of irc! then type "/phunk your message" */
/* | -oMIkRON / rEMORSE.aSCII (omi on irc) */
/* \==============-==-=======--------- ---- - - --- - - - */
#include <stdio.h>
#include <stdlib.h>
/* tHIS^tAKEN^fROM rANDOM.sEE! */
char set_to_lower(char tmp){
char x = tmp;
if((x<='Z')&&(x>='A')) {
x -= 'A';
x += 'a';
}
return x;
}
/* eND^rANDOM.sEE^sHIT */
main() {
char a_char;
int low;
low = 1;
a_char = getchar();
while(a_char!=EOF) {
if (low == 0) {
a_char = toupper(a_char);
}
if (low == 1) {
a_char = set_to_lower(a_char);
low = 0;
}
if (a_char == ' ') {
a_char = '^';
low = 1;
}
/* if you don't want colors, comment out the switch() shit! */
/* I think it looks better without colors, but Slammer requested colors */
switch(rand()%3) {
case(0): printf("\002"); break;
case(1): printf("\037"); break;
case(2): printf("\026"); break;
}
/* end of switch shit */
printf("%c",a_char);
a_char = getchar();
}
}